package com.king.designpatterns.行为模式.策略模式;

/**
 * 抽象折扣算法类
 *
 * @author king
 * @date 2021-06-10 16:35
 */
public abstract class DiscountStrategy {
    /**
     * 书的价格
     */
    private double price;
    /**
     * 书的数量
     */
    private int number;

    public DiscountStrategy(double price, int number) {
        this.price = price;
        this.number = number;
    }

    public double getPrice() {
        return price;
    }

    public int getNumber() {
        return number;
    }

    /**
     * 策略方法，计算折扣额
     */
    public abstract double calculateDiscount();
}
